#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import subprocess as sp


def myprint(obj, end='\n'):
    sys.stdout.write(str(obj) + end)


def main():
    cmd = 'systeminfo'
    p = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sp.PIPE)
    (o, e) = p.communicate()
    try:
        myprint(o.decode('gbk'))
    except:
        myprint(o)


if __name__ == '__main__':
    main()
    myprint('done')
